package com.hotel.mapper;

import com.hotel.pojo.Orders;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {
    @Select("select count(1) from orders")
    Long getTotal();

    List<Orders> ordersListByPage(@Param("start") int start,
                                 @Param("size")int size,
                                 @Param("query")String query);

    @Delete("delete from finalorder where orders_id = #{ordersId}")
    void deleteOrders(Integer ordersId);

    //    @Insert("insert into orders(orders_id,user_name,sex,phone,number,check_in,check_out,status,room_type,sale) value (null,#{userName},#{sex},#{phone},#{number},#{checkIn},#{checkOut},#{status},#{roomType},#{(select sale from room where room_type=#{roomType})})")
    void addOrders(Orders orders);


}
